package org.xiaom.butler;

import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;
import org.hibernate.classic.Session;
import org.xiaom.butler.bean.Hotel;
import org.xiaom.butler.util.HibernateUtil;

public class Test {
	public static void main(String[] args) {
		SessionFactory sf=HibernateUtil.getSessionFactory();
		Hotel h=new Hotel();
		h.setId(111);
		Session s= sf.openSession();
		Transaction t=s.beginTransaction();
		s.save(h);
		t.commit();
		
	}
}
